package oboe.controllers.jml.helpers;

import flash.events.Event;
import flash.utils.Dictionary;

import oboe.controllers.jml.JMLController;
import oboe.controllers.jml.events.JMLFormEvent;
import oboe.utils.japi;

class JMLForm extends JMLNode
{
public static inline var SIG_ONPOLLFORMINPUTS:String = "onPollFormInputs";
public static inline var SIG_ONREPLYFOR_name:String = "onReplyFor_****";

public function new( key:String, val:Object, parent:JMLController )
{
	super( key, val, parent );
}

public function slot_onSubmit():Void
{
	var values:Object = {};
	this.signalDown(SIG_ONPOLLFORMINPUTS, values);
	japi[ this.getDisplayObject().name ]( 
	onGetFormReply, 
	values 
	);
}

private function onGetFormReply( data:Object ):Void
{
	this.jmlRoot().message("onReplyFor_" + this.getDisplayObject().name, data); 
}
}